import cv2

img = cv2.imread(r'E:\picture\Lena.jpg')

#均值滤波
img_mean = cv2.blur(img, (5,5))
# 高斯滤波
img_Guassian = cv2.GaussianBlur(img,(5,5),0)

# 中值滤波
img_median = cv2.medianBlur(img, 5)

# 展示不同的图片
titles = ['srcImg','mean', 'Gaussian', 'median']
imgs = [img, img_mean, img_Guassian, img_median]

for i in range(5):
    cv2.imshow(titles[i], imgs[i])
    cv2.waitKey(1000000)

